{include file="public/layout.htm" /}
<script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
<body class="">
    <div class="ey-content back-c">
        <div class="order-detail-wrap">
            <div class="status-wrap color-base-bg">
                <div class="container">
                {eq name="$OrderData.order_status" value="0"}
                    <div class="status-pic"> <img src="__WEAPP_TEMPLATE__/skin/images/order-icon.png"> </div>
                {/eq}
                {eq name="$OrderData.order_status" value="1"}
                    <div class="status-pic"> <img src="__WEAPP_TEMPLATE__/skin/images/order-icon-send.png"> </div>
                {/eq}
                {eq name="$OrderData.order_status" value="2"}
                    <div class="status-pic"> <img src="__WEAPP_TEMPLATE__/skin/images/order-icon-receive.png"> </div>
                    {if condition="$OrderData.prom_type == 0"}
                    <div class="status-name">{$admin_order_status_arr[$OrderData.order_status]|default=''}</div>
                    {elseif condition="$OrderData.prom_type == 1"}
                    <div class="status-name">未完成</div>
                    {/if}
                {/eq}
                {eq name="$OrderData.order_status" value="3"}
                    <div class="status-pic"> <img src="__WEAPP_TEMPLATE__/skin/images/order-icon-received.png"> </div>
                    {if condition="$OrderData.prom_type == 0 || $OrderData.prom_type == 2"}
                    <div class="status-name">{$admin_order_status_arr[$OrderData.order_status]|default=''}</div>
                    {elseif condition="$OrderData.prom_type == 1"}
                    <div class="status-name">已完成</div>
                    {/if}
                {/eq}
                {in name="$OrderData.order_status" value="-1, 4"}
                    <div class="status-pic"> <img src="__WEAPP_TEMPLATE__/skin/images/order-icon-close.png"> </div>
                {/in}
                {in name="$OrderData.order_status" value="-1, 0, 1, 4"}
                    {if condition="$OrderData.logistics_type == 2"}
                    <div class="status-name"> 待核销 </div>
                    {else/}
                    <div class="status-name"> {$admin_order_status_arr[$OrderData.order_status]|default=''} </div>
                    {/if}
                {/in}
                </div>
            </div>

            <div class="address-wrap">
                <div class="icon">
                    <i class="iconfont icon-dizhi"></i>
                </div>
                <div class="address-info">
                    <div class="info">
                        {eq name="$OrderData.logistics_type" value="2"} {$weappVerifyLog.buyer} {else /} {$OrderData.consignee} {/eq}
                        {eq name="$OrderData.logistics_type" value="2"} {$weappVerifyLog.phone} {else /} {$OrderData.mobile} {/eq}
                    </div>
                    {eq name="$OrderData.logistics_type" value="2"}
                    <div class="detail">核销码：{$weappVerifyLog.verify_code}</div>
                    {/eq}
                    {if condition="$OrderData.prom_type == 0 && $OrderData.logistics_type == 1"}
                    <div class="detail">{$OrderData.province}-{$OrderData.city}-{$OrderData.district}-{$OrderData.address}</div>
                    {/if}
                </div>
            </div>

            <div class="block-wrap">
                {foreach name="DetailsData" item="vo" key="k" }
                <div class="goods-item-wrap">
                    <div class="goods-item">
                        <div class="goods-img"> <img src="{$vo.litpic}"> </div>
                        <div class="info-wrap">
                            <div class="name-wrap">{$vo.product_name}</div>
                            {notempty name="$vo.spec_value_list"}
                            <div class="spec-wrap">{volist name="$vo.spec_value_list" id="sp"}<span>{$sp.value} </span>{/volist}</div>
                            {/notempty}
                            <div class="more-wrap">
                                <div class="goods-class"></div>
                                <div class="price-wrap">
                                    <div class="price">
                                        {empty name="$OrderData.points_shop_order"}<span class="unit">￥</span>{/empty}
                                        <span class="div-text">{$vo.product_price}</span>
                                    </div>
                                    <div class="num">x{$vo.num}</div>
                                    {if condition="!empty($vo.actualPayPrice)"}
                                    <div class="dispatch"><span class="">实付款￥</span>{$vo.actualPayPrice}</div>
                                    {/if}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                {/foreach}
            </div>

            <div class="block-wrap">
                <div class="title">订单信息</div>
                <div class="order-cell">
                    <div class="tit"><span>订单编号：</span></div>
                    <div class="box">{$OrderData.order_code}</div>
                    <div class="copy color-base-text order_code" onclick="textCopy('order_code');" data-clipboard-text="{$OrderData.order_code}">复制</div>
                </div>
                <div class="order-cell">
                    <div class="tit"><span>订单类型：</span></div>
                    <div class="box">{$OrderData.prom_type_name}</div>
                </div>
                <div class="order-cell">
                    <div class="tit"><span>订单来源：</span></div>
                    <div class="box">{$OrderData.order_terminal_name}</div>
                </div>
                <div class="order-cell">
                    <div class="tit"><span>付款方式：</span></div>
                    <div class="box">{eq name="$vo.order_source" value="30"}积分兑换{else/}{$pay_method_arr[$OrderData.pay_name]|default='微信支付'}{/eq}</div>
                </div>
                <div class="order-cell">
                    <div class="tit"><span>买家信息：</span></div>
                    <div class="box">
                        <a href="{:weapp_url('Mbackend/Member/users_edit', ['id'=>$UsersData.users_id])}" class="color-base-text"><img style="float: unset; border: 1px solid #e9edef; width: 24px; height: 24px; border-radius: 50%;" src="{$UsersData.head_pic}">{$UsersData.nickname}</a>
                    </div>
                </div>
                {notempty name="$OrderData.user_note"}
                <div class="order-cell">
                    <div class="tit"><span>买家留言：</span></div>
                    <div class="box">
                        {$OrderData.user_note}
                    </div>
                </div>
                {/notempty}
                {notempty name="$OrderData.express_order"}
                <div class="order-cell">
                    <div class="tit"><span>配送方式：</span></div>
                    <div class="box">{if condition="$OrderData.prom_type == 0"}{eq name="$OrderData.logistics_type" value="1"}物流配送{else/}到店自提{/eq}{elseif condition="$OrderData.prom_type == 1"}无需物流{/if}</div>
                </div>
                {/notempty}
                <div class="order-cell">
                    <div class="tit"><span>创建时间：</span></div>
                    <div class="box">{$OrderData.add_time}</div>
                </div>
                {neq name="OrderData.pay_time" value="0"}
                <div class="order-cell">
                    <div class="tit"><span>支付时间：</span></div>
                    <div class="box">{$OrderData.pay_time}</div>
                </div>
                {/neq}
            </div>

            <div class="block-wrap">
                <div class="order-cell">
                    <div class="tit"><span>商品金额</span></div>
                    <div class="box align-right pd0 bold">
                        {empty name="$OrderData.points_shop_order"}
                        <span class="fs11">￥</span>
                        {/empty}
                        <span class="color-title">{$OrderData.order_total_amount}</span>
                    </div>
                </div>
                {notempty name="$OrderData.coupon_id"}
                <div class="order-cell">
                    <div class="tit"><span>优惠券</span></div>
                    <div class="box align-right pd0 bold">
                        <span class="fs11">-￥</span>
                        <span class="div-text">{$OrderData.coupon_price}</span>
                    </div>
                </div>
                {/notempty}
                {eq name="$OrderData.order_source" value="10"}
                <div class="order-cell">
                    <div class="tit"><span>运费</span></div>
                    <div class="box align-right pd0 bold">
                        <span class="fs11">￥</span>
                        <span class="div-text">{$OrderData.shipping_fee}</span>
                    </div>
                </div>
                <div class="order-cell">
                    <div class="box align-right pd0 bold">
                        <span class="div-text">共{$total_num}件商品，实付金额：</span>
                        {empty name="$OrderData.points_shop_order"}
                        <span class="fs11 color-base-text">￥</span>
                        {/empty}
                        <span class="font-size-base color-base-text">{$OrderData.order_amount}</span>
                    </div>
                </div>
                {/eq}
                {if condition="30 == $OrderData.order_source && $OrderData.pay_use_scores > 0"}
                <div class="order-cell">
                    <div class="tit"><span>积分兑换</span></div>
                    <div class="box align-right pd0 bold">
                        <span class="operator"></span>
                        <span class="fs11"></span>
                        <span class="div-text">{$OrderData.pay_use_scores_num}积分</span>
                    </div>
                </div>
                {/if}
            </div>

            <div class="block-wrap log">
                <div class="title color-base-text">订单日志</div>
                {foreach name="Action" item="vo" key="k" }
                <div class="item">
                    <div class="action">
                        <div class="title">
                            <span class="tit">{$vo.action_note}</span>
                            <!-- <span class="time">{$vo.add_time|MyDate='Y-m-d',###}</span> -->
                        </div>
                        <div class="con">
                            <span>操作人：{$vo.action_users}</span><br>
                            <span>操作时间：{$vo.add_time|MyDate='Y-m-d H:i:s',###}</span><br>
                            <span>订单状态：{$admin_order_status_arr[$vo.order_status]|default=''}</span>
                        </div>
                    </div>
                </div>
                {/foreach}
            </div>
            
            <div class="placeholder-height"></div>
            <div class="footer-wrap">
                <div class="container">
                    <div class="home"><a class="" href="{:weapp_url('Mbackend/Mbackend/index')}"><i class="iconfont icon-dianpu"></i></a></div>
                    {eq name="$OrderData.order_status" value="0"}
                    <!-- 订单未付款时出现 -->
                    <button class="on" onclick="orderMarkStatus('yfk', '{$OrderData.order_id}', '{$OrderData.users_id}');">确认付款</button>
                    <button class="on" onclick="promptChangePrice('{$OrderData.order_id}', '{$OrderData.order_amount}');">订单改价</button>
                    <button class="on" onclick="orderMarkStatus('gbdd', '{$OrderData.order_id}', '{$OrderData.users_id}');">关闭订单</button>
                    <!-- END -->
                    {/eq}

                    {eq name="$OrderData.order_status" value='1'}
                    <!-- 订单待发货时出现 -->
                    <!-- <button class="on" onclick="promptManualRefund('{$OrderData.order_id}');">手动退款</button> -->
                    <button class="on" onclick="unifiedJump(this);" data-url="{:weapp_url('Mbackend/Shop/order_active_refund', ['order_id'=>$OrderData.order_id])}">主动退款</button>
                    {eq name="$OrderData.logistics_type" value="2"}
                    <button class="on" onclick="orderVerify({$OrderData.order_id}, {$OrderData.users_id}, {$weappInfo['data']['openVerify']|default=0}, {$weappInfo['data']['openSecondVerify']|default=0});">确认核销</button>
                    {else /}
                    <button class="on" onclick="orderSend(this);" data-href="{:weapp_url('Mbackend/Shop/order_send', ['order_id'=>$OrderData.order_id])}">确认发货</button>
                    {/eq}
                    <!-- END -->
                    {/eq}

                    {eq name="$OrderData.order_status" value='2'}
                    <!-- 订单已发货时出现 -->
                    <button class="on" onclick="orderMarkStatus('ysh', '{$OrderData.order_id}', '{$OrderData.users_id}');">确认收货</button>
                    <button class="on" onclick="orderRemarks('{$OrderData.order_id}');">订单备注</button>
                    <!-- END -->
                    {/eq}

                    {if condition="-1 == $OrderData.order_status or 3 == $OrderData.order_status"}
                    <!-- 订单取消或订单完成时出现 -->
                    <button class="on" onclick="orderRemarks('{$OrderData.order_id}');">订单备注</button>
                    <!-- <button class="on" onclick="orderMarkStatus('ddsc','{$OrderData.order_id}','{$OrderData.users_id}');">订单删除</button> -->
                    <!-- END -->
                    {/if}

                    {if condition="-1 == $OrderData.order_status and 1 == $OrderData.manual_refund"}
                    <!-- 订单时手动退款时出现 -->
                    <button class="on" onclick="layerAlert('{$OrderData.refund_note}', '关闭');">手动退款原因</button>
                    <!-- END -->
                    {/if}
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        // 复制信息
        function textCopy(name) {
            var clipboard1 = new Clipboard("." + name);
            clipboard1.on("success", function(e) {
                layerMsg('复制成功', 1);
            });
            clipboard1.on("error", function(e) {
                layerMsg('复制失败！请手动复制', 1);
            });
        }
    </script>
    <script type="text/javascript" src="__WEAPP_TEMPLATE__/skin/js/order.js?v={$weappInfo.version|default='v1.0.10'}"></script>
</body>
{include file="public/footer.htm" /}